package com.project.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.SellOrderBean;
import com.project.service.ISellOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("sellOrder")
@Api(tags = "销售订单控制层")
public class SellOrderController {
    @Autowired
    private ISellOrderService sellOrderService;

    @GetMapping("findByItem")
    @ApiOperation("条件分页查询销售订单")
    public IPage<SellOrderBean> findByItem(Integer pageNo, String customName, LocalDate startDate, LocalDate endDate) {
        return sellOrderService.findByItem(pageNo,customName,startDate,endDate);
    }

    @GetMapping("findById")
    @ApiOperation("通过id查销售订单")
    public SellOrderBean findById(Integer sellOrderId) {
        return sellOrderService.findById(sellOrderId);
    }
}
